package com.jinsi.controller;

import com.jinsi.pojo.Dept;
import com.jinsi.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("dept")
public class DeptController {


    @Autowired
    private DeptService deptService;
// 全查
    @RequestMapping("/getAll")
    public List<Dept> getAll(){

        return deptService.getAll();
    }

// 条件模糊查询
    @RequestMapping("/getDeptsByName")
    public List<Dept> getDeptsByName(String deptName){

        return deptService.getDeptsByName(deptName);
    }
}
